// 加载层
var loadIndex = layer.load(1, { shade: [0.5, '#fff'] })
    // 定义一个async异步函数
async function getHot() {
    var hot = document.querySelector('.hot .con section');
    var hot_list = await pAjax({
        url: '../server/hot.php',
        data: { pid: 3 }
    });
    var { data } = hot_list;
    var str = '';
    data.forEach((item, index, arr) => {
        if (index <= arr.length - 3) {
            if (index === 0 || index === 1 || index === 6 || index === 7) {
                str += `
        <div>
        <li><img src="${item.imgpath}" alt=""></li>
        <div class="lable clear-fix red">${item.lable}</div>
        <div class="title">${item.title}</div>
        <div class="detail">${item.detalil}</div>
        <div class="price">${item.price}</div>
    </div>`
            } else {
                str += `
        <div>
        <li><img src="${item.imgpath}" alt=""></li>
        <div class="lable clear-fix">${item.lable}</div>
        <div class="title">${item.title}</div>
        <div class="detail">${item.detalil}</div>
        <div class="price">${item.price}</div>
    </div>`
            }
        } else {
            str += `
            <div class="bottom">
            <img src="${item.imgpath}" >
        </div>`
        }

    });
    hot.innerHTML = str;
}
layer.close(loadIndex)
    // 将拼接好的旅游景点信息字符串传递给，bj标签显示
getHot()